home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 February / maximum-cd-2012-02.iso / DiscContents / TheWagerSetup1.2.exe / Assets / Scripts / [11].lua < prev    next >
Encoding:
Text File  |  2011-02-26  |  1.4 KB  |  54 lines

  1. -- Script [11]
  2. Starting = 0;
  3. SeaEvent = 0;
  4.  
  5. function KillRandomCrewMember ()
  6.   if CrewCount >= 1 then
  7.  
  8.     CrewID = math.random(0, CrewCount);
  9.   
  10.     CrewName = GetCrewName(CrewID);
  11.  
  12.     KillCrew(CrewID);
  13.  
  14.     return CrewName;
  15.   end
  16. end
  17.  
  18. function MakePrettyList(Item) 
  19.   
  20.   Result = "";
  21.  
  22.   if # Item > 1 then
  23.  
  24.     for i = 0, # Item - 1 do
  25.       Result = Result .. Item[i] .. ", ";
  26.     end
  27.  
  28.     Result = string.sub(Result, 1, -3) .. " and " .. Item[ # Item ];
  29.  
  30.   else
  31.  
  32.     Result = Result .. Item[ # Item ];
  33.   
  34.   end
  35.  
  36.   return Result;
  37. end
  38.  
  39.  
  40. DeadCrew = {};
  41. c = 0;
  42. for i = 1, 3 do
  43.   CrewName = KillRandomCrewMember();
  44.   
  45.   if CrewName ~= "" then
  46.     DeadCrew[c] = CrewName;
  47.     c = c + 1;
  48.   end
  49. end
  50.  
  51. ShowStoryText("The crew look at you incredulously as you do nothing to stop them being ushered towards the simmering pot. A few more minutes of being drizzled with various oils and " .. DeadCrew[0] .. " rolls his eyes, signalling the crew to put up a fight. At such a severe disadvantage the battle is costly indeed. " .. MakePrettyList(DeadCrew) .. " are lost, but somehow you manage to find a window of opportunity to break through and flee back to your ship. However, it will take you several days to fully recover.");
  52.  
  53. AddDays(4);
  54. AddCaptainsLog("Escaped from a tribe of savage cannibals. In retrospect I could have been more proactive.");